package kr.hkit.myframework.uicomp;

import java.awt.GridLayout;
import java.util.HashMap;
import java.util.Set;

import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class InputPanel2 extends JPanel {
	private JLabel lbl2;
	private JComboBox comboBox;
	private HashMap<String, Integer> list;
	/**
	 * Create the panel.
	 */
	public InputPanel2(String lblStr) {

		initialize();
		this.lbl2.setText(lblStr);
	}
	private void initialize() {
		setLayout(new GridLayout(0, 2, 0, 0));
		
		lbl2 = new JLabel("New label");
		add(lbl2);
		
//		comboBox = new JComboBox();
//		add(comboBox);
		
		list = new HashMap<String, Integer>();
		list.put("영업", 1);
		list.put("기획",2);
		list.put("테스팅", 5);
		list.put("개발", 6);
		list.put("총무", 7);
		Set<String> arr= list.keySet();
		comboBox = new JComboBox<>(arr.toArray());
		add(comboBox);
	}
	public void setLbl(String title) {
		this.lbl2.setText(title);
	}
	
	public String getSelectItem(){
		return (String) comboBox.getSelectedItem();
	}
	
	public void setDefaultSelectIndex(int idx){
		comboBox.setSelectedIndex(idx);
	}
	
	public void setSelectItem(String str){
		comboBox.setSelectedItem(str);
	}

	public void addItems(String...lists){
		for(String item:lists){
			comboBox.addItem(item);
		}
	}
	
	public JComboBox<Object> getCmb() {
		return comboBox;
	}
	
	/*
	
	
	
	private void initialize() {
		setLayout(new GridLayout(0, 2, 10, 5));
		
		lbl = new JLabel();
		lbl.setHorizontalAlignment(SwingConstants.RIGHT);
		add(lbl);
		
		cmb = new JComboBox<>();
		add(cmb);
	}

	public void setLbl(String title) {
		this.lbl.setText(title);
	}
	
	public String getSelectItem(){
		return (String) cmb.getSelectedItem();
	}
	
	public void setDefaultSelectIndex(int idx){
		cmb.setSelectedIndex(idx);
	}
	
	public void setSelectItem(String str){
		cmb.setSelectedItem(str);
	}

	public void addItems(String...lists){
		for(String item:lists){
			cmb.addItem(item);
		}
	}

	public JComboBox<Object> getCmb() {
		return cmb;
	}
	 */
	
	
	
	
	
	
	
	

}
